<template>
  <component :is="icon" :spin="loading" />
</template>

<script setup>
import * as Icon from '@ant-design/icons-vue'

const props = defineProps({
  name: {
    type: String,
    default: ''
  },
  loading: {
    type: Boolean,
    default: false
  }
})
const icon = computed(() => {
  return props.loading ? Icon['LoadingOutlined'] : Icon[props.name]
})
</script>
